package com.hzhq.contract.bean.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import org.springframework.data.mongodb.core.mapping.FieldType;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author hzhq
 * @create 2021/3/24 11:06 下午
 * @email hzhq1255@163.com
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Document("contract_status")
public class ContractStatus {

    public static final String STATUS_ID_FIELD = "_id";
    public static final String CONTRACT_ID_FIELD = "contract_id";
    public static final String STATUS_NAME_FIELD = "status_name";
    public static final String PAYMENT_FIELD = "payment";
    public static final String DESC_FIELD = "desc";
    public static final String OPERATE_TIME_FIELD = "operate_time";
    public static final String DELETED_FIELD = "deleted";

    @Id
    private ObjectId statusId;
    @ApiModelProperty(value = "所属合同")
    @Field(CONTRACT_ID_FIELD)
    private ObjectId contractId;
    @ApiModelProperty(value = "状态名称")
    @Field(STATUS_NAME_FIELD)
    private String statusName;
    @ApiModelProperty(value = "收付款金额")
    @Field(value = PAYMENT_FIELD,targetType = FieldType.DECIMAL128)
    private BigDecimal payment;
    @ApiModelProperty(value = "收付款时间")
    @Field(OPERATE_TIME_FIELD)
    private Date operateTime;
    @ApiModelProperty(value = "备注")
    @Field(DESC_FIELD)
    private String desc;
    @ApiModelProperty(value = "删除状态")
    @Field(DELETED_FIELD)
    private Integer deleted;

}
